# $Id: PKGBUILD 78200 2012-10-17 10:24:29Z allan $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=jmc
pkgver=0.2.3
pkgrel=7
pkgdesc="jabber mail component"
arch=(any)
url="http://people.happycoders.org/dax/projects/jmc"
license=("GPL")
backup=(etc/ejabberd/jmc.xml)
depends=(python2 python2-pyxmpp)
install=jmc.install
source=(http://people.happycoders.org/dax/projects/release/jmc/0.2/jmc-$pkgver.tar.gz
	jmc.rc
	jmc.service)
md5sums=('89dcd54e19842619000d447bfaceb8ab'
         '7e6d343b838858155be3ef4abc28ea27'
         'eee9affe33a8e27e4d0aafffeff56cb0')

build() {
  cd $srcdir

  install -D -m0644 ./jmc-$pkgver/jmc.xml $pkgdir/etc/ejabberd/jmc.xml
  rm -f ./jmc-$pkgver/jmc.xml

  install -d -m0755 $pkgdir/usr/lib
  cp -r jmc-$pkgver/src $pkgdir/usr/lib
  mv $pkgdir/usr/lib/src $pkgdir/usr/lib/jmc

  install -Dm0755 jmc.rc $pkgdir/etc/rc.d/jmc
  install -dm0755 $pkgdir/var/spool/ejabberd/jmc
  install -Dm0644 $srcdir/jmc.service $pkgdir/usr/lib/systemd/system/jmc.service
}
